#include <iostream>
#include <random>
#include <set>

using namespace std;

int generate() {
    while (true) {
        int n = rand() % 10000;
        int curr = n;
        set<int> numbers;
        while (curr) {
            numbers.insert(curr%10);
            curr /= 10;
        }
        if (numbers.size() == 4) {
            return n;
        }
    }
}

int count_bulls(int n, int k) {
    int cnt = 0;
    while (n && k) {
        cnt += (n % 10 == k % 10)
        n /= 10;
        k /= 10;
    }
}

int count_cows(int n, int k) {
    set<int> s;
    while (n && k) {
        s.insert(n % 10), s.insert(k % 10);        
        n /= 10;
        k /= 10;
    }
    cout << 8 - s.size();

}

void game(int n) {
    while (true) {
        int k;
        cin >> k;
        if(n == k) {
            cout << "win";
            return 0;
        }
        cout << "cows: " count_cows(n, k) - count_bulls(n, k) << '\n' 
             <<"bulls: " << count_bulls(n, k) << '\n';
    }
}

int main() {
    int n = generate();
    game(n)
}